package com.example.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.bean.Orders;
import com.example.bean.ResultVo;


/**
 * @InterfaceName OrderService
 * @Author 冯泽嘉
 * @Date 2021/10/3 18:10
 */
public interface OrderService extends IService<Orders> {

    /**
     * 第一版
     */
    ResultVo getOrdersAll();

    //用户查询商品列表
    ResultVo getOrdersAllUser(int uid);

    //商家查询商品列表
    ResultVo getOrdersAllMerchant(int mid);

    ResultVo findOrderByOrderNumberUser(String orderNumber, int uid);

    ResultVo findOrderByOrderNumberMerchant(String orderNumber, int mid);

    ResultVo findOrderByMNameUser(String mName, int uid);

    ResultVo findOrderByMNameMerchant(String mName, int mid);

    ResultVo deleteOrderByOrderNumber(String orderNumber);


    /**
     * 第二版（商家）
     */
    //查询订单
    ResultVo findOrdersAllMerchant2(int mid);

    //商家根据订单号精准查询订单列表
    ResultVo findOrderByOrderNumberMerchant2(String orderNumber, int mid);

    //商家根据商品名模糊查询订单列表
    ResultVo findOrderByNameMerchant2(String gName, int mid);

    //商家修改用户收货地址
    ResultVo modifyOrderMerchant2(int uid, int gid, int mid, String oName, String oPhone, String oAddress, String cNumber);

    //商家改变用户订单状态
    ResultVo changeOrderState2(String oState, int uid, int gid, int mid, String cNumber);

    /**
     * 第二版（用户）
     */
    //查询订单
    ResultVo findOrdersAllUser2(int uid);

    //用户根据订单号精准查询订单列表
    ResultVo findOrderByOrderNumberUser2(String orderNumber, int uid);

    //用户根据商品名模糊查询订单列表
    ResultVo findOrderByNameUser2(String gName, int uid);

    //用户根据订单状态查询订单
    ResultVo findOrderByStateUser2(String oState, int uid);

    //用户改变订单状态
    ResultVo ChangeStateUser(String orderstate, int uid, String orderNumber);
    //查找最新生成的订单号
    String findNewstOrder(int uid);
    //购买减少库存
    boolean reInventory(int gid);
}
